package org.jvnet.hudson.client_demo;


import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.filter.HTTPDigestAuthFilter;

public class GetMessageFromJboss {

	public static void main(String[] args) {
	    final Client client = Client.create();
	    
	    client.addFilter(new HTTPDigestAuthFilter("jboss", "jboss1234!@#$")); // must be in the ManagementRealm
	 
	    final WebResource resource = client.resource("http://10.144.97.99:9990/management?recursive");
	 
	    
	    final WebResource.Builder requestBuilder = resource.getRequestBuilder();
	    
	    System.out.println(requestBuilder.get(String.class));
	    //System.out.println(requestBuilder.type(MediaType.APPLICATION_JSON).entity(requestBuilder.get(String.class)).get(String.class));
	  }
}
